/*
 * @Author: WangGuojian 1085844536@qq.com
 * @Date: 2022-09-19 17:39:21
 * @LastEditTime: 2022-09-20 13:49:05
 * @LastEditors: WangGuojian 1085844536@qq.com
 * @FilePath: \pro05-demo-all-in-one\src\main\java\com\atguigu\imperial\court\dao\impl\EmpDaoImpl.java
 * @Description:
 */
package com.atguigu.imperial.court.dao.impl;

import com.atguigu.imperial.court.dao.BaseDao;
import com.atguigu.imperial.court.dao.api.EmpDao;
import com.atguigu.imperial.court.entity.Emp;

public class EmpDaoImpl extends BaseDao<Emp> implements EmpDao {

    @Override
    public Emp selectEmpByLoginAccount(String loginAccount, String encodedLoginPassword) {

        // 1.编写 SQL 语句
        String sql = "select emp_id empId," +
                "emp_name empName," +
                "emp_position empPosition," +
                "login_account loginAccount," +
                "login_password loginPassword " +
                "from t_emp where login_account=? and login_password=?";

        // 2.调用父类的方法查询单个对象
        return super.getSingleBean(sql, Emp.class, loginAccount, encodedLoginPassword);
    }
}
